﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using AI.Fuzzy.Library;
using System.Text;
using System.Windows.Forms;
using Sharp3DMath.Strokes;
using System.Resources;

namespace SketchRecognise
{
 
    public partial class RecogniseResultPanel : UserControl
    {
        List<System.Windows.Forms.Label> labels;
        List<System.Windows.Forms.PictureBox> pictureBoxs;
        public RecogniseResultPanel()
        {
            InitializeComponent();
            labels = new List<Label>(14);
            pictureBoxs = new List<PictureBox>(14);
            MyInitializeComponent();
        }
        protected void MyInitializeComponent()
        {
            labels.Add(label1);
            labels.Add(label2);
            labels.Add(label3);
            labels.Add(label4);
            labels.Add(label5);
            labels.Add(label6);
            labels.Add(label7);
            labels.Add(label8);
            labels.Add(label9);
            labels.Add(label10);
            labels.Add(label11);
            labels.Add(label12);
            labels.Add(label13);
            labels.Add(label14);

            pictureBoxs.Add(pictureBox1);
            pictureBoxs.Add(pictureBox2);
            pictureBoxs.Add(pictureBox3);
            pictureBoxs.Add(pictureBox4);
            pictureBoxs.Add(pictureBox5);
            pictureBoxs.Add(pictureBox6);
            pictureBoxs.Add(pictureBox7);
            pictureBoxs.Add(pictureBox8);
            pictureBoxs.Add(pictureBox9);
            pictureBoxs.Add(pictureBox10);
            pictureBoxs.Add(pictureBox11);
            pictureBoxs.Add(pictureBox12);
            pictureBoxs.Add(pictureBox13);
            pictureBoxs.Add(pictureBox14);

        }

        public void LoadFrom(LRSS_SharpResult sharpResult)
        {
             ResourceManager RM = new ResourceManager(GetType());
            for (int i = 0; i < sharpResult.Count; i++)
            {
                labels[i].Text = sharpResult[i].sharpName+" "+sharpResult[i].value.ToString();
                pictureBoxs[i].Image = (System.Drawing.Bitmap)RM.GetObject(sharpResult[i].sharpName);
            }
        }

        private void RecogniseResultPanel_Load(object sender, EventArgs e)
        {
            //ResourceManager RM = new ResourceManager(GetType());
            //pictureBox1.Image = (System.Drawing.Bitmap)RM.GetObject("Line");
            //pictureBox2.Image = (System.Drawing.Bitmap)RM.GetObject("Triangle");
            //pictureBox3.Image = (System.Drawing.Bitmap)RM.GetObject("Rectangle");
            //pictureBox4.Image = (System.Drawing.Bitmap)RM.GetObject("Circles");
            //pictureBox5.Image = (System.Drawing.Bitmap)RM.GetObject("Trapezia");
            //pictureBox6.Image = (System.Drawing.Bitmap)RM.GetObject("Ellipse");
            //pictureBox7.Image = (System.Drawing.Bitmap)RM.GetObject("Diamond");
            //pictureBox8.Image = (System.Drawing.Bitmap)RM.GetObject("Delete");
            //pictureBox9.Image = (System.Drawing.Bitmap)RM.GetObject("Pentacle");
            //pictureBox10.Image = (System.Drawing.Bitmap)RM.GetObject("Arc");
            //pictureBox11.Image = (System.Drawing.Bitmap)RM.GetObject("Curve");
            //pictureBox12.Image = (System.Drawing.Bitmap)RM.GetObject("FoldLine");
            //pictureBox13.Image = (System.Drawing.Bitmap)RM.GetObject("ConcentricHelix");
            //pictureBox14.Image = (System.Drawing.Bitmap)RM.GetObject("Spiral");
        }
    }
}
